﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml.Linq;
using System.Linq;

namespace ArmoryBrowser.Entities.AchievementDetails
{
    public class Achievements
    {
        #region Fields
        private Category _categoryField;
        private String _langField;
        private String _requestUrlField;
        #endregion
        #region Properties
        public Category Category
        {
            get
            {
                return this._categoryField;
            }
            set
            {
                this._categoryField = value;
            }
        }

        public String Lang
        {
            get
            {
                return this._langField;
            }
            set
            {
                this._langField = value;
            }
        }

        public String RequestUrl
        {
            get
            {
                return this._requestUrlField;
            }
            set
            {
                this._requestUrlField = value;
            }
        }
        #endregion
        #region Constructor
        public Achievements(XElement element)
        {
            Lang = element.GetAttributeValue("lang");
            RequestUrl = element.GetAttributeValue("requestUrl");
            Category = element.Elements("category").Select(e => new Category(e)).SingleOrDefault();
        }
        #endregion
    }
}
